# -*- coding: utf-8 -*-
# @Time    : 2022/4/10 21:20
# @Author  : zyw
# @Email   : panda_kings@163.com
# @File    : category.py
import traceback

from flask import Blueprint,jsonify
from flask_restful import Api,Resource,marshal

# from common.models.channeles import Channels
from common.model_fields.channel_fields import channel_fields

# 创建频道的蓝图对象
channel_bp= Blueprint('category', __name__, url_prefix="/category")

api = Api(channel_bp)


# class CategoryRes(Resource):
#     def get(self):
#         """获取所有的频道"""
#         try:
#             channels = Channels.query.all()
#             # 使用序列化返回
#             return marshal(channels, channel_fields)
#         except Exception as e:
#             err = traceback.format_exc()
#             print("获取频道信息错误_{}".format(err))
#             return jsonify({'msg':"获取频道信息失败","code":400})



# api.add_resource(CategoryRes,'/infos')







